<!--
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-02-08 10:46:36
 * @Description  : 基础信息
-->
<template>
  <setting-container v-slot="{ handleChange }">
    <div class="header flex items-center">
      <left-line></left-line>
      <div class="title text-[16px]">基础信息</div>
    </div>
    <n-divider class="!my-2" />
    <n-form
      ref="formRef"
      :label-width="200"
      :label-placement="menuShow ? 'left' : 'top'"
      label-align="left"
      :model="settings"
      size="small"
      require-mark-placement="left"
    >
      <n-form-item label="公司产品名：" path="companyName">
        <n-input
          class="!w-[300px]"
          :value="settings.companyName"
          @update:value="(value: string) => handleChange('companyName', value)"
          :allow-input="noSideSpace"
          placeholder="请输入公司产品名"
          :maxlength="50"
          clearable
        />
        <div class="ml-[12px] text-gray-400 text-[12px]">用于产品logo标题</div>
      </n-form-item>
      <n-form-item label="公司副标题：" path="companySubName">
        <n-input
          class="!w-[300px]"
          :value="settings.companySubName"
          @update:value="
            (value: string) => handleChange('companySubName', value)
          "
          placeholder="请输入公司副标题"
          :allow-input="noSideSpace"
          clearable
          :maxlength="50"
        />
        <div class="ml-[12px] text-gray-400 text-[12px]">产品副标题</div>
      </n-form-item>
      <n-form-item label="列表目录排除：" path="ingoreSources">
        <n-input
          class="!w-[300px]"
          :value="settings.ingoreSources"
          @update:value="
            (value: string) => handleChange('ingoreSources', value)
          "
          placeholder="请输入排除的列表目录"
          :allow-input="noSideSpace"
          clearable
        />
        <div class="ml-[12px] text-gray-400 text-[12px]">
          默认不显示的目录和文件,逗号隔开
        </div>
      </n-form-item>
      <n-form-item label="新用户默认创建目录：" path="newUserDefaultSources">
        <n-input
          class="!w-[300px]"
          :value="settings.newUserDefaultSources"
          @update:value="
            (value: string) => handleChange('newUserDefaultSources', value)
          "
          placeholder="请输入新用户默认创建目录"
          :allow-input="noSideSpace"
          clearable
        />
        <div class="ml-[12px] text-gray-400 text-[12px]">用逗号隔开</div>
      </n-form-item>
    </n-form>
  </setting-container>
</template>

<script setup lang="ts">
import type { IndexObj } from '@/types/commom'
import { noSideSpace } from '@/utils'
import SettingContainer from './SettingContainer.vue'

defineProps<{
  settings: IndexObj
  menuShow: boolean
}>()
</script>

<style scoped lang="scss"></style>
